package exception;

import java.io.FileNotFoundException;

//异常的抛出
public class ThrowDemo {
    public static void main(String[] args) {
        Student zs=new Student();

        try {
            zs.setAge(99);
        } catch ( Exception e) {
            //e.printStackTrace(); 打印错误堆栈信息
            System.out.println(e.getMessage());//获取错误信息并输出
        }
        System.out.println(zs.getAge());



    }
}
